Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feralfile Exhibition V4 #19

Merged
merged 50 commits into from
Jun 29, 2023
Merged

Feralfile Exhibition V4 #19

merged 50 commits into from
Jun 29, 2023

Conversation

tienngovan
Copy link
Contributor

No description provided.

contracts/FeralfileArtworkV4.sol Outdated Show resolved Hide resolved
contracts/FeralfileArtworkV4.sol Show resolved Hide resolved
contracts/FeralfileArtworkV4.sol Outdated Show resolved Hide resolved
contracts/FeralfileArtworkV4.sol Outdated Show resolved Hide resolved
@lemonlatte lemonlatte force-pushed the FF_V4 branch 2 times, most recently from ac4b47c to 08c7af9 Compare June 7, 2023 03:06
/// @param tokenIds an array of token ID
function burnArtworks(uint256[] memory tokenIds) external {
for (uint256 i = 0; i < tokenIds.length; i++) {
_burnArtwork(tokenIds[i]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_burnArtwork(tokenIds[i]);
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_burnArtwork(tokenIds[i]);

@jollyjoker992 the external function can be called for users so we need to check the ownership before burn tokens.

Copy link
Contributor

@lemonlatte lemonlatte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
/// @notice Stop token selling and transfer remaining tokens back to the underlying addresses
function stopSaleAndTransfer(
Copy link
Contributor

@lemonlatte lemonlatte Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a chance to stop the sale with only part of series transfer tokens to addresses. This means the sale can start with the remaining tokens again. I think we need to ensure either:

  • the length of seriesIds is same to the length of _seriesMaxSupplies
  • balanceOf(address(this)) == 0

  • The first approach would need to introduce another key since we can not count the length of a map directly.
  • The later one would waste more gas since we can only check after we burn all tokens.

lemonlatte
lemonlatte previously approved these changes Jun 27, 2023
Copy link
Contributor

@lemonlatte lemonlatte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 82 to 86
address signer_,
bool burnable_,
bool bridgeable_,
address vault_,
address costReceiver_,
Copy link
Contributor

@lpopo0856 lpopo0856 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small: put the same type params in order. though it wont save gas in function param, but it's better for reading

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lpopo0856 I dont think so, we should put the params based on the meaning like something is similar could put together. In this case, i will bring the signer next to vault and cost receiver.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok!

}

/// @notice Set vault contract
/// @dev don't allow to set signer as zero address
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: set vault

resumeSale();
}

/// @notice Resume token selling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small: consistent wording between selling and sale

_selling = false;
}

/// @notice Stop token selling and burn remaining tokens
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

}
}

/// @notice Stop token selling and transfer remaining tokens back to the underlying addresses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

/// @notice the cost receiver address
/// @param costReceiver_ - the address of cost receiver
function setCostReceiver(address costReceiver_) external onlyOwner {
costReceiver = costReceiver_;
Copy link
Contributor

@lpopo0856 lpopo0856 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing costReceiver_ != address(0) check

function setTokenBaseURI(string memory baseURI_) external onlyAuthorized {
_tokenBaseURI = baseURI_;
function setTokenBaseURI(string memory baseURI_) external onlyOwner {
tokenBaseURI = baseURI_;
Copy link
Contributor

@lpopo0856 lpopo0856 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing bytes(baseURI_).length > 0 check

for (uint16 j = 0; j < seriesIds.length; j++) {
if (artwork.seriesId == seriesIds[j]) {
address to = recipientAddresses[j];
_transfer(from, to, tokenId);
Copy link
Contributor

@lpopo0856 lpopo0856 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using _safeTransfer?

lpopo0856
lpopo0856 previously approved these changes Jun 27, 2023
jollyjoker992
jollyjoker992 previously approved these changes Jun 27, 2023
@jollyjoker992 jollyjoker992 dismissed stale reviews from lpopo0856 and themself via 78295a7 June 27, 2023 10:28
Copy link
Contributor

@lemonlatte lemonlatte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lemonlatte lemonlatte merged commit ff80a5d into main Jun 29, 2023
2 checks passed
@lemonlatte lemonlatte deleted the FF_V4 branch June 29, 2023 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants